<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p id="intro">hello world!</p>
    <p>该实例展示了getElementById()</p>
<script>
    var x = document.getElementById("intro");
    document.write("<p>文本来自 id 为 intro 段落: " + x.innerHTML);
</script>
    
</body>
</html>